package com.gulimall.product.web;

import com.gulimall.product.service.impl.SpuInfoServiceImpl;
import com.gulimall.product.vo.ItemVo.SkuItemVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @Author Rookie-6688
 * @Description 商品详情页
 * @Create 2021-04-13 22:37
 */
@Controller
public class ItemController {

    @Resource
    SpuInfoServiceImpl spuInfoServiceImpl;


    @RequestMapping("/{skuId}.html")
    public String item(@PathVariable Long skuId, Model model){
        SkuItemVo skuItemVo = spuInfoServiceImpl.getProductItem(skuId);
        model.addAttribute("item",skuItemVo);
        return "item";
    }
}
